home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / PowerMacInterface / appleevents.icl < prev    next >
Encoding:
Modula Implementation  |  1996-03-01  |  2.6 KB  |  73 lines  |  [TEXT/3PRM]

  1. implementation module appleevents;
  2.  
  3. TypeApplSignature    :== 0x7369676E;    // 'sign'
  4. KCoreEventClass        :==    0x61657674;    // 'aevt'
  5. KAEMiscStandards    :== 0x6D697363;    // 'misc'
  6. KAEQuitApplication    :==    0x71756974;    // 'quit'
  7. KAEDoScript            :== 0x646F7363;    // 'dosc'
  8. KeyDirectObject        :== 0x2D2D2D2D;    // '----'
  9. TypeChar            :== 0x54455854;    // 'TEXT'
  10. KeyErrorNumber        :== 0x6572726E;    // 'errn'
  11. KeyErrorString        :== 0x65727273;    // 'errs'
  12. TypeLongInteger        :== 0x6C6F6E67;    // 'long'
  13.  
  14. SizeOfAEDesc :== 8;
  15. SizeOfAppleEvent :== 8;
  16.  
  17. KAutoGenerateReturnID :== -1;
  18. KAnyTransactionID :== 0;
  19. KAENoReply :== 1;
  20. KAEWaitReply :== 3;
  21. KAENormalPriority :== 0;
  22. KNoTimeOut :== -2;
  23.  
  24. :: AEDescPtr :== Int;
  25. :: AppleEventPtr :== Int;
  26.  
  27. AECreateDesc :: !Int !{#Char} !AEDescPtr -> Int;
  28. AECreateDesc typeCode data result_p = code (typeCode=D0,data=U,result_p=D3)(error_code=D0){
  29.     instruction 0x80B70004    |    lwz        r5,4(r23)
  30.     instruction 0x38970008    |    addi    r4,r23,8
  31.     call    .AECreateDesc
  32. }
  33.  
  34. AECreateAppleEvent :: !Int !Int !AEDescPtr !Int !Int !AppleEventPtr -> !Int;
  35. AECreateAppleEvent theAEEventClass theAEEventID target returnID transactionID result_p
  36. = code (theAEEventClass=D0,theAEEventID=D1,target=D2,returnID=D3,transactionID=D4,result_p=D5)(error_code=D0){
  37.     call    .AECreateAppleEvent
  38. }
  39.  
  40. AEPutParamPtr :: !AppleEventPtr !Int !Int !{#Char} -> Int;
  41. AEPutParamPtr theAppleEvent theAEKeyword typeCode data
  42. = code (theAppleEvent=D0,theAEKeyword=D1,typeCode=D2,data=U)(error_code=D0){
  43.     instruction 0x80F70004    |    lwz        r7,4(r23)
  44.     instruction 0x38D70008    |    addi    r6,r23,8
  45.     call    .AEPutParamPtr
  46. }
  47.  
  48. AESend :: !AppleEventPtr !AppleEventPtr !Int !Int !Int !Int !Int -> Int;
  49. AESend theAppleEvent reply sendMode sendPriority timeOutInTicks idleProc filterProc
  50. = code (theAppleEvent=D0,reply=D1,sendMode=D2,sendPriority=D3,timeOutInTicks=D4,idleProc=D5,filterProc=D6)(error_code=D0){
  51.     call    .AESend
  52. }
  53.  
  54. AEGetIntParamPtr :: !AppleEventPtr !Int !Int -> (!Int,!Int,!Int,!Int);
  55. AEGetIntParamPtr theAppleEvent theAEKeyword desiredType
  56. = code (theAppleEvent=R12D0,theAEKeyword=D1,desiredType=O0D3O4D4O8D6D2)(error_code=D0,typeCode=L,value=L,actualSize=L){
  57.     instruction 0x39000004    |    li    r8,4
  58.     call    .AEGetParamPtr
  59. }
  60.  
  61. AEGetStringParamPtr :: !AppleEventPtr !Int !Int !{#Char} -> (!Int,!Int,!Int);
  62. AEGetStringParamPtr theAppleEvent theAEKeyword desiredType string
  63. = code (theAppleEvent=R8D0,theAEKeyword=D1,desiredType=D2,string=O0D3O4D6U)(error_code=D0,typeCode=L,actualSize=L){
  64.     instruction 0x81170004    |    lwz        r8,4(r23)
  65.     instruction 0x38F70008    |    addi    r7,r23,8
  66.     call    .AEGetParamPtr
  67. }
  68.  
  69. AEDisposeDesc :: !AEDescPtr -> Int;
  70. AEDisposeDesc theAEDesc = code (theAEDesc=D0)(error_code=D0){
  71.     call    .AEDisposeDesc
  72. }
  73.